﻿<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="pt-BR">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Sequencia de Array</title>
 
<script type="text/javascript">


function gama(x){
	
	var sequencia = [];
	
		for(var loop=0;loop<=x;loop++){
		// 2 for(var loop=0;loop<=x;)
			//1 sequencia.unshift(count);
			sequencia.push(loop);
			//2 sequencia[loop] = loop++;	
		}

		
		
	return sequencia;	
}
var num = prompt("Digite um numero para a contagem","")
console.log(gama(num));

/*1  console.log(gama(15).sort(function(a,b){
	return a-b;
}));*/





</script>
</head>

<body>

</body>

</html>

